	<div class="posts index">
		<h2><?php __('Posts');?></h2>
		<table class="index" cellpadding="0" cellspacing="0">
		<tr>
				
				<th><?php echo $this->Paginator->sort('status');?></th>
				<th><?php echo $this->Paginator->sort('id');?></th>
				<th><?php echo $this->Paginator->sort('name');?></th>
				<th><?php echo $this->Paginator->sort('added');?></th>
				<th><?php echo $this->Paginator->sort('modified');?></th>
				<th class="actions"><?php __('Actions');?></th>
		</tr>
		<?php
		$i = 0;
		foreach ($posts as $post):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php 
				echo $this->Form->create('Post',array('url'=>array('controller'=>'posts','action'=>'activate')));
				echo $this->Form->hidden('id',array('value'=>$post['Post']['id']));
				echo $this->Form->checkbox("status",array('label'=>false,'checked'=>(($post['Post']['status'])?'checked':'false'),'id'=>"PostStatus{$post['Post']['id']}",'hiddenField' => false));
				echo $this->Form->end();
				echo $ajax->observeField( 'PostStatus'.$post['Post']['id'], array('url' => array( 'action' => 'activate')));
				?>
			</td>
			<td><?php echo $post['Post']['id']; ?>&nbsp;</td>
			<td><?php echo $post['Post']['name']; ?>&nbsp;</td>
			<td><?php echo $post['Post']['added']; ?>&nbsp;</td>
			<td><?php echo $post['Post']['modified']; ?>&nbsp;</td>
			<td class="actions">
				<?php echo $this->Html->link(__('View', true), array('action' => 'view', $post['Post']['id'])); ?>
				<?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $post['Post']['id'])); ?>
				<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $post['Post']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $post['Post']['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
		</table>
		<p>
		<?php
		echo $this->Paginator->counter(array(
		'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
		));
		?>	</p>
	
		<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
		<?php echo $this->Paginator->numbers(array('separator'=>false));?>
	 	<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
		</div>
	</div>
	
	


<?php if($session->check('Auth.User.id')){?>
<?php echo $this->element('toolbar_actions_main',array('plugin'=>'blog','toolbar'=>'posts'))?>
<?php }?>	